<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<style type="text/css">
			
		</style>
	</head>
	<body>
		<div id="app">
			请输入你的姓氏：<input type="text" v-model="firstMsg" /><br>
			
			请输入你的名字：<input type="text" v-model="lastMsg" /><br>
			
			您的姓名为：<span>{{fullMsg}}</span>
		</div>
	</body>
	<script src="../vue.js" type="text/javascript" charset="utf-8"></script>
	<script type="text/javascript">
			
		new Vue({
			el:"#app",
			data:{
				firstMsg:"",
				lastMsg:"",
				fullMsg:""
			},
			watch:{
				firstMsg(newVal,oldVal){
					this.fullMsg = newVal + this.lastMsg
				},
				lastMsg(newVal,oldVal){
					this.fullMsg = this.firstMsg + newVal
				}
			}
		})
		
		
		
	</script>
</html>
